<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Schedule',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/05/25.jpg" alt="Trees along the road" class="framed-centred-image" width="649" height="480"/>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		My discussion post for the day:
	</p>
	<blockquote>
		<img src="/img/CC_BY-SA_4.0/y.st./coursework/CS2204/simultaneous_close.png" alt="ladder diagram" class="framed-centred-image" width="335" height="230"/>
		<p>
			A simultaneous connection termination occurs when both sides send their respective FIN packets before having yet received that of the other node.
			Both nodes enter the FIN_WAIT_1 (Where is FIN_WAIT_0? Seriously, we&apos;re computer scientists, we should know better than to skip zero.) stage, as they&apos;ve sent their FIN without having received one yet.
			At this point, both nodes are attempting to take the active close path and make the other node take the passive close path.
			However, both nodes then receive not an ACK, confirmation that the FIN was received, but instead the FIN packet from the other node.
			At this point, both nodes are waiting for the ACK in regards to their own FIN, but neither is waiting for a FIN from the other end, as it&apos;s already been received.
			As a result, both move into the LAST_ACK stage, essentially having jumped the track from the active close path to the passive close path.
			Upon receipt of the final ACK from the other node, each node enters the TIMEWAIT state to give the other node time to receive the final ACK sent to them.
			Of course, barring any lost packets or strange congestion that slowed packets one way but not the other, both nodes have already received their respective final ACKs at this point.
			Additionally, this TIMEWAIT state keeps the line tied up long enough for any lingering packets from the connection to make their way out so as to not contaminate a future connection.
		</p>
		<p>
			To answer the question of which node goes into the TIMEWAIT state, both of them.
			Because both sides attempted to close the connection at the same time, both sides of the connection at this point are behaving symmetrically.
			If one side is doing something, the other side&apos;s going to be trying to do something similar.
			As such, there are only three logical options: they both go into TIMEWAIT, neither goes into TIMEWAIT, or there&apos;s some sort of error condition.
			The designers of $a[TCP] decided to choose the option in which they both go into TIMEWAIT, allowing for the clearing of the lines and the retransmission of final ACKs if needed.
		</p>
		<div class="APA_references">
			<h3>References:</h3>
			<p>
				Dordal, P. (2014). 12 TCP Transport - An Introduction to Computer Networks, edition 1.9.10. Retrieved from <a href="https://intronetworks.cs.luc.edu/current/html/tcp.html"><code>https://intronetworks.cs.luc.edu/current/html/tcp.html</code></a>
			</p>
		</div>
	</blockquote>
</section>
<section id="schedule">
	<h2>Trading shifts</h2>
	<p>
		A coworker asked to give me their Thursday shift and take my Tuesday shift so they could get work done on their new tattoo.
		I agreed to the switch, but when I next looked at the schedule, I&apos;d lost my Monday shift and kept my Tuesday shift.
		Either the boss messed up or the two of them agreed on a new plan and not only didn&apos;t ask me if I was okay with it, but also didn&apos;t let me know it had happened.
		Honestly, I&apos;m guessing the latter.
		How am I supposed to show up for work on even the right <strong>*day*</strong> if they mess with my schedule and don&apos;t even give me the right information!?
		It was lucky that I even went back to check the schedule again and noticed.
	</p>
</section>
END
);
